Introduction ✔
- Intro
- 28 March, 2026: 00.28.15 ❌
- Failed at edge cases
- Add a new
Nodeclass outsideLinkedListclass Node{
public:
int val;
Node* next;
Node(int val){
this->val = val;
this->next = NULL;
}
}; - Define required static variable inside
LinkedListclass but outside consider.int size = 0;
Node* head;
Node* tail;
MyLinkedList() {
head = tail = NULL;
size = 0;
}
- 28 March, 2026: 00.28.15 ❌
- Insertion
- 28 March, 2026: 00.21.13 ✔
- Delete
- Length
- Search
- https://leetcode.com/problems/remove-linked-list-elements
- 26 March, 2026: 00.07.09 ✔
- Just make a new head, connected with corresponded element
- 26 March, 2026: 00.07.09 ✔
- https://leetcode.com/problems/merge-two-sorted-lists
- 27 March, 2026: 00.03.11 ✔
- https://leetcode.com/problems/finding-pairs-with-a-certain-sum/
- 28 March, 2026: 00.18.47 ❌
- Failed at optimization
- Solve
countwithin , having hashmap insidecountmake the complexity as each time count invoked, so keep it in constructor.
- 28 March, 2026: 00.18.47 ❌